package com.zl.tby.service.impl;

import com.zl.tby.model.TbyUavPoint;
import com.zl.tby.repository.TbyUavPointRepo;
import com.zl.tby.service.ITbyUavPointService;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.wood.annotation.Db;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 无人机飞行的实时点
 * @author AnWeiNan
 * @date 2024年11月05日 下午8:00
 */

@Slf4j
@Component
public class TbyUavPointServiceImpl implements ITbyUavPointService {

    @Db
    private TbyUavPointRepo tbyUavPointRepo;

    @Override
    public void add(String deviceId, String point) {
        TbyUavPoint entity = new TbyUavPoint();
        entity.setDeviceId(deviceId);
        entity.setPoint(point);
        entity.setCreateTime(LocalDateTime.now());
        tbyUavPointRepo.insert(entity, true);
    }
}
